package data;

import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

import main.Core;

/**
 * 
 * @author Ygor
 * 
 */
public class ImageSprite extends Sprite {
	protected BufferedImage bufferedImage; // protected faz com que ele seja private para o resto do mundo mas
	private int height;                    // mas public para as classes filhas.
	private int width;

	@Override
	public void Draw(Graphics2D g) {
		if (this.isVisible()) {
			g.drawImage(bufferedImage, (int)this.getX(), (int)this.getY(), width, height, null);
		}
	}
	@Override
	public void Update(float elapsedTime) {
	}
	

	public ImageSprite(BufferedImage img, int x, int y, int w, int h, Core c) {
		super(x, y, true, c);
		this.bufferedImage = img;
		this.width = w;
		this.height = h;
	}

	/**
	 * @return the bufferedImage
	 */
	public BufferedImage getBufferedImage() {
		return bufferedImage;
	}

	@Override
	/**
	 * @return the height
	 */
	public int getHeight() {
		return height;
	}

	/**
	 * @param height
	 *            the height to set
	 */
	public void setHeight(int height) {
		this.height = height;
	}

	@Override
	/**
	 * @return the width
	 */
	public int getWidth() {
		return width;
	}

	/**
	 * @param width
	 *            the width to set
	 */
	public void setWidth(int width) {
		this.width = width;
	}
}
